<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .zong {
        background: #F5F5F5;
    }

    .shang {
        position: relative;
        width: 1226px;
        height: 58px;
        -webkit-font-smoothing: antialiased;
        margin: auto;
    }

    .shang .biaoti {
        position: absolute;
        top: 0;
        right: 120px;
    }

    .shang .biaoti ul {
        margin: 0;
        padding: 16px 0 0;
        list-style-type: none;
        font-size: 16px;
    }

    .shang .biaoti ul li {
        margin: 0 0 0 30px;
        color: #424242;

        float: right;
    }

    .shang .biaoti ul li:hover {
        cursor: pointer;
        border-bottom: 2px solid #ff6700;
        color: #ff6700;
        transition: border 0.5s;
    }

    .xia {
        width: 992px;
        height: 574px;
        margin: auto;
        border: 1px solid #424242;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
        background: #F5F5F5;
    }

    .xia ul {

        width: 992px;
        height: 574px;

    }

    .xia ul li {
        height: 270px;
        width: 234px;
        float: left;
        display: block;
        background: #FFFFFF;

        box-sizing: border-box;
        padding: 20px 0;
        margin: 6px 0 14px 11px;

    }

    .xia ul li:hover {
        cursor: pointer;
        box-shadow: 5px 5px 30px #888;
        transform: translateY(-5px);
    }

    .xia ul li img {
        width: 160px;
        height: 160px;
        margin-left: 34px;
    }

    h3 {
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        color: #333;
        margin: 0 10px 2px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;

    }

    p {
        margin: 0 10px 10px;
        height: 18px;
        font-size: 12px;
        color: #b0b0b0;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    span {
        margin: 0 10px 10px;
        text-align: center;
        color: #ff6700;
        display: block;
        margin-block-start: 1em;
        margin-block-end: 1em;
        margin-inline-start: 0px;
        margin-inline-end: 0px;
    }
</style>

<body>
    <div class="zong">
        <div class="shang">
            <div class="biaoti">
                <ul>
                    <li>扫地机</li>
                    <li>空净</li>
                    <li>清洁</li>
                    <li>风扇</li>
                </ul>
            </div>
        </div>
        <div class="xia">
            <ul>

            </ul>
        </div>
    </div>
    <script src="./a(1).js"></script>

    <script>
        var xia = document.querySelector('.xia').querySelector('ul');
        var shanglis = document.querySelector('.shang').querySelector('ul').querySelectorAll('li');




        for (let i = 0; i < shanglis.length; i++) {             
            shanglis[i].onmouseenter = function () {
                xia.innerHTML = '';
                for (let j = 0; j < 8; j++) {
                    xia.innerHTML = xia.innerHTML + `<li>     
                <div><img src="${arr[i].data[j].url}"></img</div>
  <h3>${arr[i].data[j].title}</h3>
<p>${arr[i].data[j].desc}</p >
 <span>${arr[i].data[j].price}</span>
        </li>`
                }
            }       
 
        }
        for (let i = 0; i < 8; i++) {
            xia.innerHTML = xia.innerHTML + `<li>     
                <div><img src="${arr[0].data[i].url}"></img</div>
  <h3>${arr[0].data[i].title}</h3>
<p>${arr[0].data[i].desc}</p >
 <span>${arr[0].data[i].price}</span>
        </li>`
        }
        var xialis = document.querySelector('.xia').querySelector('ul').querySelectorAll('li');
    </script>
</body>

</html>